/* jshint indent: 2 */

module.exports = function(sequelize, DataTypes) {
  return sequelize.define('fUser', {
    id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
      field: 'id'
    },
    openid: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'openid'
    },
    password: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'password'
    },
    phone: {
      type: DataTypes.STRING(60),
      allowNull: true,
      field: 'phone'
    },
    address: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'address'
    },
    money: {
      type: "DOUBLE(22,3)",
      allowNull: true,
      field: 'money'
    },
    totalEarning: {
      type: "DOUBLE(120,3)",
      allowNull: true,
      field: 'total_earning'
    },
    todayEarning: {
      type: "DOUBLE(120,3)",
      allowNull: true,
      field: 'today_earning'
    },
    qrCode: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'qr_code'
    },
    freezingIntegral: {
      type: "DOUBLE(255,3)",
      allowNull: true,
      field: 'freezing_integral'
    },
    earningConGet: {
      type: "DOUBLE(255,3)",
      allowNull: true,
      field: 'earning_con_get'
    },
    recommenderId: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
      field: 'recommender_id'
    },
    nickName: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'nick_name'
    },
    avatarUrl: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'avatar_url'
    },
    gender: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      field: 'gender'
    }
  }, {
    tableName: 'f_user'
  });
};
